package com.zyylr.classroomreservationsystem.web;

import com.zyylr.classroomreservationsystem.bean.Msg;
import com.zyylr.classroomreservationsystem.bean.Reservation;
import com.zyylr.classroomreservationsystem.bean.User;

import java.util.Calendar;
import java.util.List;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;

public interface IReservation {
    /**
     * 发起添加预约记录请求
     *
     * @param reservation
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @PUT("reservation")
    Call<Msg> getReservationCall(@Body Reservation reservation);

    /**
     * 查询指定用户的所有预约记录
     *
     * @param user 用户，应当是当前登录的用户
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("reservation")
    Call<Msg<List<Reservation>>> getReservationCallByUser(@Body User user);

    /**
     * 查询未审核的预约记录
     *
     * @return
     */
    @GET("reservation/not_audited")
    Call<Msg<List<Reservation>>> getNotAuditedReservationsCall();

    /**
     * 查询已审核的预约记录
     *
     * @returna
     */
    @GET("reservation/audited")
    Call<Msg<List<Reservation>>> getAuditedReservationsCall();
}
